package com.zy.web.demo.duoxiancheng.demo31;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/9/3 9:59
 */
public class TestA31 {

    public static void main(String[] args) throws InterruptedException {
        final ServiceA31 serviceA31 = new ServiceA31();
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                serviceA31.await();
            }
        };
        Thread[] threads = new Thread[10];
        for (int i = 0; i < threads.length; i++) {
            threads[i] = new Thread(runnable);
        }
        for (int i = 0; i < threads.length; i++) {
            threads[i].start();
        }
        Thread.sleep(2000);
        serviceA31.notityMethod();
    }

}
